import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
	redirect:"/login"
  },	
  {
    path: '/login',
  	component:() => import('../views/Login.vue'),
  },	
  {
    path: '/home',
    name: 'Home',
    component:() => import('../views/Home.vue'),
	meta:{comp:"/home",pathname:"首页",name:"首页"},	
	children:[
		//-----------------------系统管理
		{
			path: '/system-manage/userlist',
			name: 'userlist',
			component:() => import('../views/home/system-manage/UserList.vue'),
			meta:{comp:"/system-manage/userlist",pathname:"用户管理",name:"用户信息"}
		},
		{
			path: '/system-manage/rolelist',
			name: 'rolelist',
			component:() => import('../views/home/system-manage/RoleList.vue'),
			meta:{comp:"/rolelist",pathname:"系统管理",name:"角色管理"}
		},
		{
			path: '/system-manage/functionlist',
			name: 'functionlist',
			component:() => import('../views/home/system-manage/Functions.vue'),
			meta:{comp:"/system-manage/functionlist",pathname:"系统管理",name:"功能管理"}
		},
		{
			path: '/system-manage/news',
			name: 'news',
			component:() => import('../views/home/system-manage/News.vue'),
			meta:{comp:"/system-manage/news",pathname:"系统管理",name:"通知管理"}
		},
		//-----------------------人事管理
		{
			path: '/position-manage/positionlist',
			name: 'positionlist',
			component:() => import('../views/home/position-manage/PositionList.vue'),
			meta:{comp:"/position-manage/positionlist",pathname:"人事管理",name:"职工信息"}
		},
		{
			path: '/position-manage/positionadd',
			name: 'positionadd',
			component:() => import('../views/home/position-manage/PositionAdd.vue'),
			meta:{comp:"/position-manage/positionadd",pathname:"人事管理",name:"职工添加"}
		},
		{
			path: '/position-manage/leavelist',
			name: 'leavelist',
			component:() => import('../views/home/position-manage/LeaveList.vue'),
			meta:{comp:"/position-manage/leavelist",pathname:"人事管理",name:"职工请假"}
		},
		//-----------------------接待管理
		{
			path: '/reception-manage/visitlist',
			name: 'visitlist',
			component:() => import('../views/home/reception-manage/VisitList.vue'),
			meta:{comp:"/reception-manage/visitlist",pathname:"接待管理",name:"来访记录"}
		},
		{
			path: '/reception-manage/bedlist',
			name: 'bedlist',
			component:() => import('../views/home/reception-manage/BedList.vue'),
			meta:{comp:"/reception-manage/bedlist",pathname:"接待管理",name:"床位信息"}
		},
		{
			path: '/reception-manage/appointment',
			name: 'appointment',
			component:() => import('../views/home/reception-manage/appointment.vue'),
			meta:{comp:"/reception-manage/appointment",pathname:"接待管理",name:"老人预约信息"}
		},
		// {
		//   path: '/playinformation',
		//   name: 'playinformation',
		//   component:() => import('../views/home/PlayerInformation.vue'),
		//   meta:{comp:"/playinformation",pathname:"玩家管理",name:"玩家信息"}
		// },
		
		// {
		//   path: '/newguide',
		//   name: 'newguide',
		//   component:() => import('../views/home/NewGuide.vue'),
		//   meta:{comp:"/newguide",pathname:"玩家管理",name:"新手引导"}
		// },
		// {
		//   path: '/rolezr',
		//   name: 'rolezr',
		//   component:() => import('../views/home/RoleZR.vue'),
		//   meta:{comp:"/rolezr",pathname:"角色管理",name:"角色整容"}
		// },
		// {
		//   path: '/recharge',
		//   name: 'recharge',
		//   component:() => import('../views/home/Recharge.vue'),
		//   meta:{comp:"/recharge",pathname:"角色管理",name:"充值玩家"}
		// },
		// {
		//   path: '/hangup',
		//   name: 'hangup',
		//   component:() => import('../views/home/HangUP.vue'),
		//   meta:{comp:"/hangup",pathname:"角色管理",name:"挂机关卡"}
		// },
		// {
		//   path: '/dwrecharge',
		//   name: 'dwrecharge',
		//   component:() => import('../views/home/dwRecharge.vue'),
		//   meta:{comp:"/dwrecharge",pathname:"付费与货币",name:"档位充值"}
		// },
		// {
		//   path: '/racedrawtimes',
		//   name: 'racedrawtimes',
		//   component:() => import('../views/home/Racedrawtimes.vue'),
		//   meta:{comp:"/racedrawtimes",pathname:"付费与货币",name:"种族抽"}
		// },
		// {
		//   path: '/retention',
		//   name: 'retention',
		//   component:() => import('../views/home/Retention.vue'),
		//   meta:{comp:"/retention",pathname:"留存率",name:"留存率查询"}
		// },
		// {
		//   path: '/activationcode',
		//   name: 'activationcode',
		//   component:() => import('../views/home/Activationcode.vue'),
		//   meta:{comp:"/activationcode",pathname:"激活码",name:"激活码查询"}
		// },
		// {
		//   path: '/rolegift',
		//   name: 'rolegift',
		//   component:() => import('../views/home/Rolegift.vue'),
		//   meta:{comp:"/rolegift",pathname:"物品流水",name:"角色物品流水"}
		// },
		// {
		//   path: '/notice',
		//   name: 'notice',
		//   component:() => import('../views/home/Notice.vue'),
		//   meta:{comp:"/notice",pathname:"公告/跑马灯",name:"公告"}
		// },
		// {
		//   path: '/pmd',
		//   name: 'pmd',
		//   component:() => import('../views/home/Pmd.vue'),
		//   meta:{comp:"/pmd",pathname:"公告/跑马灯",name:"跑马灯"}
		// },
		// {
		//   path: '/mail',
		//   name: 'mail',
		//   component:() => import('../views/home/Mail.vue'),
		//   meta:{comp:"/mail",pathname:"邮件管理",name:"邮件查询"}
		// },
		// {
		//   path: '/ban',
		//   name: 'ban',
		//   component:() => import('../views/home/Ban.vue'),
		//   meta:{comp:"/ban",pathname:"封禁",name:"封禁查询"}
		// },
		//-----------------------后勤管理
		{
			path: '/logistics-manage/goods',
			name: 'goods',
			component:() => import('../views/home/logistics-manage/Goods'),
			meta:{comp:"/logistics-manage/goods",pathname:"后勤管理",name:"物品管理"}
		},
		{
			path: '/logistics-manage/appli_management',
			name: 'appli_management',
			component:() => import('../views/home/logistics-manage/Appli_management'),
			meta:{comp:"/logistics-manage/appli_management",pathname:"后勤管理",name:"物品申请管理"}
		},
		{
			path: '/logistics-manage/storeroom',
			name: 'storeroom',
			component:() => import('../views/home/logistics-manage/Storeroom'),
			meta:{comp:"/logistics-manage/storeroom",pathname:"后勤管理",name:"出入库管理"}
		},
		{
			path: '/logistics-manage/supplier',
			name: 'supplier',
			component:() => import('../views/home/logistics-manage/Supplier'),
			meta:{comp:"/logistics-manage/supplier",pathname:"后勤管理",name:"供应商管理"}
		},
		{
			path: '/logistics-manage/food',
			name: 'food',
			component:() => import('../views/home/logistics-manage/food-manage/FoodManage.vue'),
			meta:{comp:"/logistics-manage/food",pathname:"后勤管理",name:"膳食管理"}
		},
		//-----------------------财务管理
		{
			path: '/finance-manage/recharge',
			name: 'recharge',
			component:() => import('../views/home/finance-manage/Recharge'),
			meta:{comp:"/finance-manage/recharge",pathname:"财务管理",name:"充值缴费"}
		},
		{
			path: '/finance-manage/oldmanbills',
			name: 'oldmanbills',
			component:() => import('../views/home/finance-manage/OldmanBills'),
			meta:{comp:"/finance-manage/oldmanbills",pathname:"财务管理",name:"老人账单"}
		},
		{
			path: '/finance-manage/incomecount',
			name: 'incomecount',
			component:() => import('../views/home/finance-manage/IncomeCount'),
			meta:{comp:"/finance-manage/incomecount",pathname:"财务管理",name:"机构收支"}
		},
		{
			path: '/finance-manage/operatecount',
			name: 'operatecount',
			component:() => import('../views/home/finance-manage/OperateCount'),
			meta:{comp:"/finance-manage/operatecount",pathname:"财务管理",name:"运营统计"}
		},
		//-----------------------老人管理
		{
			path: '/oldman-manage/file_management',
			name: 'file_management',
			component:() => import('../views/home/oldman-manage/file_management'),
			meta:{comp:"/oldman-manage/file_management",pathname:"老人管理",name:"档案管理"}
		},
		//-----------------------图报表
		{
			path: '/index',
			name: 'index',
			component:() => import('../views/home/Echarts'),
			meta:{comp:"/index",pathname:"",name:"首页"}
		},
		//-----------------------通知
		// {
		// 	path: '/inform',
		// 	name: 'inform',
		// 	component:() => import('../views/home/Inform'),
		// 	meta:{comp:"/inform",pathname:"",name:"通知"}
		// },
		//-----------------------服务管理
		{
			path: '/service-manage/servicelist',
			name: 'servicelist',
			component:() => import('../views/home/service-manage/ServiceList.vue'),
			meta:{comp:"/service-manage/servicelist",pathname:"服务管理",name:"老人申请"}
		},
		{
			path: '/service-manage/servicechange',
			name: 'servicechange',
			component:() => import('../views/home/service-manage/ServiceChange.vue'),
			meta:{comp:"/service-manage/servicechange",pathname:"服务管理",name:"服务调整"}
		},
	]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})
const VueRouterPush = VueRouter.prototype.push
VueRouter.prototype.push = function push (to) {
  return VueRouterPush.call(this, to).catch(err => err)
}
export default router
